package com.igoal.web.security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.security.Authentication;
import org.springframework.security.ui.logout.SecurityContextLogoutHandler;

import com.igoal.entity.User;

public class CustomizedLogoutHandler extends SecurityContextLogoutHandler {
	@Override
	public void logout(HttpServletRequest request,
			HttpServletResponse response, Authentication authentication) {
		if(authentication == null || authentication.getPrincipal() == null)
			return;
		
		LoginStatus.logout(((User)authentication.getPrincipal()).getUsername());
//		super.logout(request, response, authentication);
	}
}
